-- 同一个客户下 所有分公司共用角色

-- 公司管理 必须有一个总部  所有公司都在总部下面  只有一个门店的就只有总部一个机构

-- drop database if EXISTS hrms;
-- CREATE DATABASE `hrms` CHARACTER SET 'utf8' COLLATE 'utf8_general_ci';

-- ALTER TABLE tblist ADD PARTITION (PARTITION e VALUES IN (20));

TRUNCATE TABLE sys_menu;
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (1, -1, '采购入库', 1, 'a/b', 'cg');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (2, -1, '销售出库', 2, 'a/b', 'xs');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (3, -1, '库存管理', 3, 'a/b', 'ck');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (4, -1, '财务结算', 4, 'a/b', 'bb');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (6, -1, '基础设置', 6, 'a/b', 'zl');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (7, -1, '系统管理', 7, 'a/b', 'set');

INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (101, 1, '采购订单', 2, 'purchase/purchase/purchase_add', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (102, 1, '采购单', 3, 'purchase/buy/buy_add', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (103, 1, '采购退货单', 4, 'purchase/rebuy/rebuy_add', 'order');

INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (130, 1, '采购订单跟踪表', 1, 'report/purchase_track', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (131, 1, '采购明细表', 2, 'report/purchase_detail', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (132, 1, '采购汇总表（商品）', 3, 'report/purchase_sum_pro', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (133, 1, '采购汇总表（供应商）', 3, 'report/purchase_sum_ven', 'order');




INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (200, 2, '销售订单', 1, 'market/market/market_add', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (202, 2, '销售单', 3, 'market/sale/sale_add', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (203, 2, '销售退货单', 4, 'market/resale/resale_add', 'order');

INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (230, 2, '销售订单跟踪表', 3, 'report/market_track', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (231, 2, '销售明细表', 3, 'report/market_detail', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (232, 2, '销售汇总表（供应商）', 3, 'report/market_sum_pro', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (233, 2, '销售汇总表（客户）', 3, 'report/market_sum_cus', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (234, 2, '销售利润表', 3, 'report/market_profit', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (235, 2, '销售排行榜', 3, 'report/market_profit', 'order');


INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (300, 3, '调拨单', 2, 'stone/transfer/transfer_add', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (301, 3, '拆装单', 3, 'stone/split/split_add', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (302, 3, '库存盘点', 4, 'stone/check/check_add', 'order');
-- INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (303, 3, '成本调整单', 5, 'stone/cost/cost_add', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (304, 3, '其它入库单', 6, 'stone/otherin/otherin_add?type=1', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (305, 3, '其它出库单', 7, 'stone/otherin/otherin_add?type=2', 'order');

INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (330, 3, '库存余额表', 3, 'stone/stoneproduct/stoneproduct_list', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (331, 3, '收发明细表', 3, 'report/storedetail', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (332, 3, '收发汇总表', 3, 'report/inoutdetail', 'order');

INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (400, 4, '收款单', 1, 'finance/receipt/receipt_add?type=1', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (401, 4, '付款单', 2, 'finance/receipt/receipt_add?type=2', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (402, 4, '其它收入单', 3, 'finance/other/other_add?type=1', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (403, 4, '其它支出单', 4, 'finance/other/other_add?type=2', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (404, 4, '核销单', 5, 'a/b', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (406, 4, '资金转账单', 7, 'finance/trans/fintrans_add', 'order');

INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (430, 4, '客户对账单', 3, 'report/customer_comp', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (431, 4, '供应商对账单', 3, 'report/vendor_comp', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (432, 4, '应收账款明细表', 3, 'report/vendor_comp', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (433, 4, '应付账款明细表', 3, 'report/vendor_comp', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (434, 4, '资金流水表', 3, 'report/vendor_comp', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (435, 4, '利润表', 3, 'report/profit', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (436, 4, '采购销售费用清单', 6, 'a/b', 'order');



INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (600, 6, '商品管理', 1, 'basics/product/product_list', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (601, 6, '商品分类', 3, 'basics/producttype/producttype_list', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (602, 6, '单位管理', 4, 'basics/unit/unit_list', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (603, 6, '收支科目', 11, 'basics/resubject/resubject_list', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (604, 6, '账户管理', 12, 'finance/account/account_list', 'order');

INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (630, 6, '仓库管理', 2, 'stone/stone/stone_list', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (631, 6, '供应商管理', 7, 'basics/vendor/vendor_list', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (632, 6, '供应商类别', 8, 'basics/vendortype/vendortype_list', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (633, 6, '客户管理', 9, 'basics/customer/customer_list', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (634, 6, '客户类别', 10, 'basics/customertype/customertype_list', 'order');



INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (700, 7, '组织机构', 1, 'system/company/company_list', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (701, 7, '角色管理', 3, 'system/role/role_list', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (702, 7, '员工管理', 4, 'system/user/user_list', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (703, 7, '打印管理', 6, 'system/print/print_list', 'order');

INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (730, 7, '参数设置', 5, 'system/config', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (731, 7, '重新核算成本', 6, 'system/print/print_list', 'order');
INSERT INTO `sys_menu`(`id`, `parent_id`, `name`, `sort`, `href`, `icon`) VALUES (732, 7, '重新初始化数据', 6, 'system/print/print_list', 'order');


TRUNCATE TABLE sys_dict;
ALTER TABLE `sys_dict` ADD COLUMN `customer_id` char(20) NOT NULL;
INSERT INTO `sys_dict`(`id`, `code`, `value`, `type`, `comments`,customer_id) VALUES (1, 1000000000, 0, 0, '盘存锁 1盘存中 0已盘存','0123456789');
INSERT INTO `sys_dict`(`id`, `code`, `value`, `type`, `comments`,customer_id) VALUES (200, 2000000001, 0, 1, '启用审核','0123456789');
INSERT INTO `sys_dict`(`id`, `code`, `value`, `type`, `comments`,customer_id) VALUES (201, 2000000002, 0, 1, '启用负库存','0123456789');
-- 0平均1先进先出
INSERT INTO `sys_dict`(`id`, `code`, `value`, `type`, `comments`,customer_id) VALUES (202, 2000000003, 1, 1, '计价方式','0123456789');
INSERT INTO `sys_dict`(`id`, `code`, `value`, `type`, `comments`,customer_id) VALUES (203, 2000000004, 0, 1, '开启多门店模式','0123456789');
INSERT INTO `sys_dict`(`id`, `code`, `value`, `type`, `comments`,customer_id) VALUES (204, 2000000005, 0, 1, '启用序列号','0123456789');
INSERT INTO `sys_dict`(`id`, `code`, `value`, `type`, `comments`,customer_id) VALUES (205, 2000000005, 0, 1, '启用保质期管理','0123456789');



TRUNCATE TABLE sys_customer_0123456789;
INSERT INTO `sys_customer_0123456789`(`id`, `name`, `code`, `date`, `balance`, `company_id`, `debt_money`, `customer_type_id`, `contact`, `contact_phone`, `address`, `other_contact`, `remarks`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,advance_in_balance,advance_out_balance) VALUES (1, '移动', '0010001', -1, -1, 200000001, 0, -1, '-1', '-1', '', '-1', '-1', 1, 1, -1, -1,0,0);
INSERT INTO `sys_customer_0123456789`(`id`, `name`, `code`, `date`, `balance`, `company_id`, `debt_money`, `customer_type_id`, `contact`, `contact_phone`, `address`, `other_contact`, `remarks`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,advance_in_balance,advance_out_balance) VALUES (2, '电信', '0010002', -1, -1, 200000001, 0, -1, '-1', '-1', '', '-1', '-1', 1, 1, -1, -1,0,0);
INSERT INTO `sys_customer_0123456789`(`id`, `name`, `code`, `date`, `balance`, `company_id`, `debt_money`, `customer_type_id`, `contact`, `contact_phone`, `address`, `other_contact`, `remarks`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,advance_in_balance,advance_out_balance) VALUES (3, '联通', '0010003', -1, -1, 200000001, 0, -1, '-1', '-1', '', '-1', '-1', 1, 1, -1, -1,0,0);
INSERT INTO `sys_customer_0123456789`(`id`, `name`, `code`, `date`, `balance`, `company_id`, `debt_money`, `customer_type_id`, `contact`, `contact_phone`, `address`, `other_contact`, `remarks`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,advance_in_balance,advance_out_balance) VALUES (4, '阿里', '0010004', -1, -1, 200000001, 0, -1, '-1', '-1', '', '-1', '-1', 1, 1, -1, -1,0,0);
INSERT INTO `sys_customer_0123456789`(`id`, `name`, `code`, `date`, `balance`, `company_id`, `debt_money`, `customer_type_id`, `contact`, `contact_phone`, `address`, `other_contact`, `remarks`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,advance_in_balance,advance_out_balance) VALUES (5, '腾讯', '0010005', -1, -1, 200000001, 0, -1, '-1', '-1', '', '-1', '-1', 1, 1, -1, -1,0,0);
INSERT INTO `sys_customer_0123456789`(`id`, `name`, `code`, `date`, `balance`, `company_id`, `debt_money`, `customer_type_id`, `contact`, `contact_phone`, `address`, `other_contact`, `remarks`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,advance_in_balance,advance_out_balance) VALUES (6, '百度', '0010006', -1, -1, 200000001, 0, -1, '-1', '-1', '', '-1', '-1', 1, 1, -1, -1,0,0);
INSERT INTO `sys_customer_0123456789`(`id`, `name`, `code`, `date`, `balance`, `company_id`, `debt_money`, `customer_type_id`, `contact`, `contact_phone`, `address`, `other_contact`, `remarks`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,advance_in_balance,advance_out_balance) VALUES (7, '360', '0010007', -1, -1, 200000001, 0, -1, '-1', '-1', '', '-1', '-1', 1, 1, -1, -1,0,0);
INSERT INTO `sys_customer_0123456789`(`id`, `name`, `code`, `date`, `balance`, `company_id`, `debt_money`, `customer_type_id`, `contact`, `contact_phone`, `address`, `other_contact`, `remarks`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,advance_in_balance,advance_out_balance) VALUES (8, '抖音', '0010008', -1, -1, 200000001, 0, -1, '-1', '-1', '', '-1', '-1', 1, 1, -1, -1,0,0);
INSERT INTO `sys_customer_0123456789`(`id`, `name`, `code`, `date`, `balance`, `company_id`, `debt_money`, `customer_type_id`, `contact`, `contact_phone`, `address`, `other_contact`, `remarks`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,advance_in_balance,advance_out_balance) VALUES (9, '今日头条', '0010009', -1, -1, 200000001, 0, -1, '-1', '-1', '', '-1', '-1', 1, 1, -1, -1,0,0);
INSERT INTO `sys_customer_0123456789`(`id`, `name`, `code`, `date`, `balance`, `company_id`, `debt_money`, `customer_type_id`, `contact`, `contact_phone`, `address`, `other_contact`, `remarks`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,advance_in_balance,advance_out_balance) VALUES (10, '央视', '0010010', -1, -1, 200000001, 0, -1, '-1', '-1', '', '-1', '-1', 1, 1, -1, -1,0,0);
INSERT INTO `sys_customer_0123456789`(`id`, `name`, `code`, `date`, `balance`, `company_id`, `debt_money`, `customer_type_id`, `contact`, `contact_phone`, `address`, `other_contact`, `remarks`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,advance_in_balance,advance_out_balance) VALUES (11, '广电', '00100011', -1, -1, 200000001, 0, -1, '-1', '-1', '', '-1', '-1', 1, 1, -1, -1,0,0);
INSERT INTO `sys_customer_0123456789`(`id`, `name`, `code`, `date`, `balance`, `company_id`, `debt_money`, `customer_type_id`, `contact`, `contact_phone`, `address`, `other_contact`, `remarks`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,advance_in_balance,advance_out_balance) VALUES (12, '铁通', '00100012', -1, -1, 200000001, 0, -1, '-1', '-1', '', '-1', '-1', 1, 1, -1, -1,0,0);
update sys_customer_0123456789 set customer_type_id = 1548065660738824849;


TRUNCATE TABLE sys_company_0123456789;
INSERT INTO `sys_company_0123456789`(`id`, `name`, `code`, `logical_code`, `parent_id`, `contact`, `contact_phone`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (200000001, '总部', '000', '100', -1, 'admin', '13888888888', 300000001, 20181227001408, -1, -1);
INSERT INTO `sys_company_0123456789`(`id`, `name`, `code`, `logical_code`, `parent_id`, `contact`, `contact_phone`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (200000002, '曾都区店', '000', '100001', 200000001, 'admin', '13888888888', 300000001, 20181227001408, -1, -1);
INSERT INTO `sys_company_0123456789`(`id`, `name`, `code`, `logical_code`, `parent_id`, `contact`, `contact_phone`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (200000003, '随县店', '000', '100002', 200000001, 'admin', '13888888888', 300000001, 20181227001408, -1, -1);
INSERT INTO `sys_company_0123456789`(`id`, `name`, `code`, `logical_code`, `parent_id`, `contact`, `contact_phone`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (200000004, '广水店', '000', '100003', 200000001, 'admin', '13888888888', 300000001, 20181227001409, -1, -1);
INSERT INTO `sys_company_0123456789`(`id`, `name`, `code`, `logical_code`, `parent_id`, `contact`, `contact_phone`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (200000005, '北郊店', '000', '100001001', 200000002, 'admin', '13888888888', 300000001, 20181227001409, -1, -1);
INSERT INTO `sys_company_0123456789`(`id`, `name`, `code`, `logical_code`, `parent_id`, `contact`, `contact_phone`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (200000006, '南郊店', '000', '100001002', 200000002, 'admin', '13888888888', 300000001, 20181227001409, -1, -1);
INSERT INTO `sys_company_0123456789`(`id`, `name`, `code`, `logical_code`, `parent_id`, `contact`, `contact_phone`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (200000007, '小林店', '000', '100002001', 200000003, 'admin', '13888888888', 300000001, 20181227001409, -1, -1);
INSERT INTO `sys_company_0123456789`(`id`, `name`, `code`, `logical_code`, `parent_id`, `contact`, `contact_phone`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (200000008, '淮河店', '000', '100002002', 200000003, 'admin', '13888888888', 300000001, 20181227001409, -1, -1);
INSERT INTO `sys_company_0123456789`(`id`, `name`, `code`, `logical_code`, `parent_id`, `contact`, `contact_phone`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (200000009, '高城店', '000', '100002003', 200000003, 'admin', '13888888888', 300000001, 20181227001409, -1, -1);



TRUNCATE TABLE sys_account_0123456789;
INSERT INTO `sys_account_0123456789`(`id`, `name`, `init_balance`, `type`, `init_date`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,balance) VALUES (1, '现金账户', 0, 1, 111, 200000001, 1, 1, 1, 1,0);
INSERT INTO `sys_account_0123456789`(`id`, `name`, `init_balance`, `type`, `init_date`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,balance) VALUES (2, '银行账户', 100, 1, 111, 200000001, 1, 1, 1, 1,0);
INSERT INTO `sys_account_0123456789`(`id`, `name`, `init_balance`, `type`, `init_date`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,balance) VALUES (3, '微信账户', 200, 1, 111, 200000001, 1, 1, 1, 1,0);
INSERT INTO `sys_account_0123456789`(`id`, `name`, `init_balance`, `type`, `init_date`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,balance) VALUES (4, '支付宝账户', 300, 1, 111, 200000001, 1, 1, 1, 1,0);



TRUNCATE TABLE sys_vendor_type_0123456789;
INSERT INTO `sys_vendor_type_0123456789`(`id`,company_id, `name`, `logical_code`, `parent_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (1,200000001, '原材料', '100', -1, 1, 1, 1, 1);
INSERT INTO `sys_vendor_type_0123456789`(`id`,company_id, `name`, `logical_code`, `parent_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (2,200000001, '小额服务型', '200', -1, 1, 1, 1, 1);
INSERT INTO `sys_vendor_type_0123456789`(`id`,company_id, `name`, `logical_code`, `parent_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (3,200000001, '临时服务性', '300', -1, 1, 1, 1, 1);



TRUNCATE TABLE sys_vendor_0123456789;
INSERT INTO `sys_vendor_0123456789`(`id`, `name`, `code`, `date`, `balance`, `company_id`, `vendor_type_id`, `contact`, `contact_phone`, `address`, `other_contact`, `remarks`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,debt_money,advance_in_balance,advance_out_balance) VALUES (1, '伊利', '0011', 0, 0, 200000001, 1, '马云', '13100002222', '惺惺惜惺惺1', '1顶顶顶顶顶顶顶1', '', 1, 1, 1, 1,0,0,0);
INSERT INTO `sys_vendor_0123456789`(`id`, `name`, `code`, `date`, `balance`, `company_id`, `vendor_type_id`, `contact`, `contact_phone`, `address`, `other_contact`, `remarks`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,debt_money,advance_in_balance,advance_out_balance) VALUES (2, '格力', '0012', 0, 0, 200000001, 1, '董明珠', '16584541203', '惺惺惜惺惺2', '1顶顶顶顶顶顶顶2', '', 1, 1, 1, 1,0,0,0);
INSERT INTO `sys_vendor_0123456789`(`id`, `name`, `code`, `date`, `balance`, `company_id`, `vendor_type_id`, `contact`, `contact_phone`, `address`, `other_contact`, `remarks`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,debt_money,advance_in_balance,advance_out_balance) VALUES (3, '蒙牛', '0014', 0, 0, 200000001, 1, '马化腾', '15345874985', '惺惺惜惺惺3', '1顶顶顶顶顶顶顶3', '', 1, 1, 1, 1,0,0,0);
INSERT INTO `sys_vendor_0123456789`(`id`, `name`, `code`, `date`, `balance`, `company_id`, `vendor_type_id`, `contact`, `contact_phone`, `address`, `other_contact`, `remarks`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,debt_money,advance_in_balance,advance_out_balance) VALUES (4, '蒙牛2', '0014', 0, 0, 200000001, 1, '史玉柱', '15345874985', '惺惺惜惺惺3', '1顶顶顶顶顶顶顶3', '', 1, 1, 1, 1,0,0,0);
INSERT INTO `sys_vendor_0123456789`(`id`, `name`, `code`, `date`, `balance`, `company_id`, `vendor_type_id`, `contact`, `contact_phone`, `address`, `other_contact`, `remarks`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,debt_money,advance_in_balance,advance_out_balance) VALUES (5, '蒙牛3', '0014', 0, 0, 200000001, 2, '王健林', '15345874985', '惺惺惜惺惺3', '1顶顶顶顶顶顶顶3', '', 1, 1, 1, 1,0,0,0);
INSERT INTO `sys_vendor_0123456789`(`id`, `name`, `code`, `date`, `balance`, `company_id`, `vendor_type_id`, `contact`, `contact_phone`, `address`, `other_contact`, `remarks`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,debt_money,advance_in_balance,advance_out_balance) VALUES (6, '蒙牛4', '0014', 0, 0, 200000001, 3, '康熙', '15345874985', '惺惺惜惺惺3', '1顶顶顶顶顶顶顶3', '', 1, 1, 1, 1,0,0,0);
INSERT INTO `sys_vendor_0123456789`(`id`, `name`, `code`, `date`, `balance`, `company_id`, `vendor_type_id`, `contact`, `contact_phone`, `address`, `other_contact`, `remarks`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,debt_money,advance_in_balance,advance_out_balance) VALUES (7, '蒙牛5', '0014', 0, 0, 200000001, 1, '雍正', '15345874985', '惺惺惜惺惺3', '1顶顶顶顶顶顶顶3', '', 1, 1, 1, 1,0,0,0);
INSERT INTO `sys_vendor_0123456789`(`id`, `name`, `code`, `date`, `balance`, `company_id`, `vendor_type_id`, `contact`, `contact_phone`, `address`, `other_contact`, `remarks`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,debt_money,advance_in_balance,advance_out_balance) VALUES (8, '蒙牛6', '0014', 0, 0, 200000001, 1, '秦始皇', '15345874985', '惺惺惜惺惺3', '1顶顶顶顶顶顶顶3', '', 1, 1, 1, 1,0,0,0);
INSERT INTO `sys_vendor_0123456789`(`id`, `name`, `code`, `date`, `balance`, `company_id`, `vendor_type_id`, `contact`, `contact_phone`, `address`, `other_contact`, `remarks`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,debt_money,advance_in_balance,advance_out_balance) VALUES (9, '蒙牛7', '0014', 0, 0, 200000001, 1, '秦二世', '15345874985', '惺惺惜惺惺3', '1顶顶顶顶顶顶顶3', '', 1, 1, 1, 1,0,0,0);
INSERT INTO `sys_vendor_0123456789`(`id`, `name`, `code`, `date`, `balance`, `company_id`, `vendor_type_id`, `contact`, `contact_phone`, `address`, `other_contact`, `remarks`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,debt_money,advance_in_balance,advance_out_balance) VALUES (10, '蒙牛8', '0014', 0, 0, 200000001, 1, '孙俪', '15345874985', '惺惺惜惺惺3', '1顶顶顶顶顶顶顶3', '', 1, 1, 1, 1,0,0,0);
INSERT INTO `sys_vendor_0123456789`(`id`, `name`, `code`, `date`, `balance`, `company_id`, `vendor_type_id`, `contact`, `contact_phone`, `address`, `other_contact`, `remarks`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,debt_money,advance_in_balance,advance_out_balance) VALUES (11, '蒙牛9', '0014', 0, 0, 200000001, 1, '哒哒哒', '15345874985', '惺惺惜惺惺3', '1顶顶顶顶顶顶顶3', '', 1, 1, 1, 1,0,0,0);
INSERT INTO `sys_vendor_0123456789`(`id`, `name`, `code`, `date`, `balance`, `company_id`, `vendor_type_id`, `contact`, `contact_phone`, `address`, `other_contact`, `remarks`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,debt_money,advance_in_balance,advance_out_balance) VALUES (12, '蒙牛10', '0014', 0, 0, 200000001, 1, '放放风', '15345874985', '惺惺惜惺惺3', '1顶顶顶顶顶顶顶3', '', 1, 1, 1, 1,0,0,0);



TRUNCATE TABLE sys_user_role_0123456789;
INSERT INTO `sys_user_role_0123456789`(`id`, `user_id`, `role_id`,company_id) VALUES (1, 300000001, 400000001,200000001);
INSERT INTO `sys_user_role_0123456789`(`id`, `user_id`, `role_id`,company_id) VALUES (2, 300000002, 400000001,200000001);


TRUNCATE TABLE sys_user;
ALTER TABLE `sys_user` ADD COLUMN `customer_id` char(20) NOT NULL;
INSERT INTO `sys_user`(`id`, `company_id`, `department_id`, `username`, `password`, `code`, `name`, `sex`, `phone`, `comment`, `card_type_id`, `card_no`, `exams`, `photo`, `login_ip`, `login_time`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,customer_id) VALUES (300000001, 200000001, 1, 'admin', '176d8ab94944e3883779f50f7638fd4a', '0001', '管理员', '1', '131', '', '2', '111', '1,2,3,4,5', '', 1, '-1', 1, -1, 1, -1,'0123456789');
INSERT INTO `sys_user`(`id`, `company_id`, `department_id`, `username`, `password`, `code`, `name`, `sex`, `phone`, `comment`, `card_type_id`, `card_no`, `exams`, `photo`, `login_ip`, `login_time`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,customer_id) VALUES (300000002, 200000003, 1, 'lmm', '176d8ab94944e3883779f50f7638fd4a', '0001', '刘飞儿', '0', '131', '', '3', '111', '1,2,3,4,5', '', 1, '-1', 1, -1, 1, -1,'0123456789');



TRUNCATE TABLE sys_unit_0123456789;
INSERT INTO `sys_unit_0123456789`(`id`, `name`, `type`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (1, '件', 1, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_unit_0123456789`(`id`, `name`, `type`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (2, '包', 1, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_unit_0123456789`(`id`, `name`, `type`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (3, '个', 1, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_unit_0123456789`(`id`, `name`, `type`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (4, '桶', 1, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_unit_0123456789`(`id`, `name`, `type`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (5, '箱', 1, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_unit_0123456789`(`id`, `name`, `type`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (6, '瓶', 1, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_unit_0123456789`(`id`, `name`, `type`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (7, '袋', 1, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_unit_0123456789`(`id`, `name`, `type`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (8, '只', 1, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_unit_0123456789`(`id`, `name`, `type`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (9, '千克', 1, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_unit_0123456789`(`id`, `name`, `type`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (10, '克', 1, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_unit_0123456789`(`id`, `name`, `type`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (11, '毫克', 1, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_unit_0123456789`(`id`, `name`, `type`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (12, '千米', 1, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_unit_0123456789`(`id`, `name`, `type`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (13, '米', 1, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_unit_0123456789`(`id`, `name`, `type`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (14, '厘米', 1, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_unit_0123456789`(`id`, `name`, `type`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (15, '毫米', 1, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_unit_0123456789`(`id`, `name`, `type`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (16, '升', 1, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_unit_0123456789`(`id`, `name`, `type`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (17, '毫升', 1, 200000001, 0, -1, -1, -1);


TRUNCATE TABLE sys_store_0123456789;
INSERT INTO `sys_store_0123456789`(`id`, `name`, `default_stone`, `company_id`, `contact`, `contact_phone`, `address`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (1536467919323406630, '南郊仓库', 0, 200000006, '秦始皇', '13562547845', '', 300000001, 1536467919323, -1, -1);
INSERT INTO `sys_store_0123456789`(`id`, `name`, `default_stone`, `company_id`, `contact`, `contact_phone`, `address`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (1536467944776126410, '曾都区仓库', 0, 200000002, '芈月', '', '', 300000001, 1536467944776, -1, -1);
INSERT INTO `sys_store_0123456789`(`id`, `name`, `default_stone`, `company_id`, `contact`, `contact_phone`, `address`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (1536467982423050208, '总部仓库', 1, 200000001, '高圆圆', '', '', 300000001, 1536467982423, -1, -1);


TRUNCATE TABLE sys_role_0123456789;
INSERT INTO `sys_role_0123456789`(`id`,company_id, `name`,code,comments, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (400000001,-1, '管理员','admin','管理员', 0, -1, 0, -1);

TRUNCATE TABLE sys_product_type_0123456789;
INSERT INTO `sys_product_type_0123456789`(`id`, `name`, `logical_code`, `parent_id`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (1, '食品类', '100', -1, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_product_type_0123456789`(`id`, `name`, `logical_code`, `parent_id`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (2, '生鲜类', '200', -1, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_product_type_0123456789`(`id`, `name`, `logical_code`, `parent_id`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (3, '家电类', '300', -1, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_product_type_0123456789`(`id`, `name`, `logical_code`, `parent_id`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (4, '食品类/烟酒', '100100', 1, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_product_type_0123456789`(`id`, `name`, `logical_code`, `parent_id`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (5, '食品类/包装食品', '100101', 1, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_product_type_0123456789`(`id`, `name`, `logical_code`, `parent_id`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (6, '生鲜类/水产海鲜', '200100', 2, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_product_type_0123456789`(`id`, `name`, `logical_code`, `parent_id`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (7, '生鲜类/蔬菜', '200101', 2, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_product_type_0123456789`(`id`, `name`, `logical_code`, `parent_id`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (8, '生鲜类/水果', '200102', 2, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_product_type_0123456789`(`id`, `name`, `logical_code`, `parent_id`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (9, '家电类/大家电', '300100', 3, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_product_type_0123456789`(`id`, `name`, `logical_code`, `parent_id`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (10, '生鲜类/熟食类', '200103', 2, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_product_type_0123456789`(`id`, `name`, `logical_code`, `parent_id`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (12, '家电类/小家电', '300101', 3, 200000001, 0, -1, -1, -1);
INSERT INTO `sys_product_type_0123456789`(`id`, `name`, `logical_code`, `parent_id`, `company_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (21, '食品类/调味食品', '100103', 1, 200000001, 0, -1, -1, -1);



TRUNCATE TABLE sys_product_price_0123456789;
INSERT INTO `sys_product_price_0123456789`(`id`, `product_id`, `price1`, `price2`, `price3`, `price4`, `price5`) VALUES (1544616824788314314, 1544616824726072733, 100, 200, 300, 400, 500);

TRUNCATE TABLE sys_product_multi_unit_0123456789;
INSERT INTO `sys_product_multi_unit_0123456789`(`id`, `product_id`, `unit_id`, `rate`) VALUES (1543373464786706635, 1543373464695677204, 5, 100);
INSERT INTO `sys_product_multi_unit_0123456789`(`id`, `product_id`, `unit_id`, `rate`) VALUES (1544616824896670356, 1544616824726072733, 1, 12);
INSERT INTO `sys_product_multi_unit_0123456789`(`id`, `product_id`, `unit_id`, `rate`) VALUES (1544616824999251773, 1544616824726072733, 5, 24);

TRUNCATE TABLE sys_product_0123456789;
INSERT INTO `sys_product_0123456789`(`id`,`last_purchase_price`, `last_sale_price`, `name`, `company_id`, `code`, `product_type_id`, `model`, `unit_id`, `purchase_price`, `sale_price`, `enable_batch`, `enable_fine`, `enable_store`, `fine_days`, `warn_days`, `store_min`, `store_max`, `comments`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,barcode) VALUES (1543373464695677204,0,0, '黄鹤楼软蓝', 200000001, '100200300', 4, '', 2, 1700, 1800, 0, 0, 0, -1, -1, -1, -1, '', 300000001, 1543373464728, -1, -1,'');
INSERT INTO `sys_product_0123456789`(`id`,`last_purchase_price`, `last_sale_price`, `name`, `company_id`, `code`, `product_type_id`, `model`, `unit_id`, `purchase_price`, `sale_price`, `enable_batch`, `enable_fine`, `enable_store`, `fine_days`, `warn_days`, `store_min`, `store_max`, `comments`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,barcode) VALUES (1543373687124961853,0,0, '乡巴佬辣条', 200000001, '100200301', 5, '', 5, 210, 250, 0, 0, 0, -1, -1, -1, -1, '', 300000001, 1543373687125, -1, -1,'');
INSERT INTO `sys_product_0123456789`(`id`,`last_purchase_price`, `last_sale_price`, `name`, `company_id`, `code`, `product_type_id`, `model`, `unit_id`, `purchase_price`, `sale_price`, `enable_batch`, `enable_fine`, `enable_store`, `fine_days`, `warn_days`, `store_min`, `store_max`, `comments`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,barcode) VALUES (1543373784768273782,0,0, '螃蟹', 200000001, '100200302', 6, '', 8, 1300, 2000, 0, 0, 0, -1, -1, -1, -1, '', 300000001, 1543373784768, -1, -1,'');
INSERT INTO `sys_product_0123456789`(`id`,`last_purchase_price`, `last_sale_price`, `name`, `company_id`, `code`, `product_type_id`, `model`, `unit_id`, `purchase_price`, `sale_price`, `enable_batch`, `enable_fine`, `enable_store`, `fine_days`, `warn_days`, `store_min`, `store_max`, `comments`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,barcode) VALUES (1543373836786886770,0,0, '小白菜', 200000001, '100200303', 7, '', 3, 210, 300, 0, 0, 0, -1, -1, -1, -1, '', 300000001, 1543373836787, -1, -1,'');
INSERT INTO `sys_product_0123456789`(`id`,`last_purchase_price`, `last_sale_price`, `name`, `company_id`, `code`, `product_type_id`, `model`, `unit_id`, `purchase_price`, `sale_price`, `enable_batch`, `enable_fine`, `enable_store`, `fine_days`, `warn_days`, `store_min`, `store_max`, `comments`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,barcode) VALUES (1543373870314581012,0,0, '苹果', 200000001, '100200304', 8, '', 3, 300, 500, 0, 0, 0, -1, -1, -1, -1, '', 300000001, 1543373870314, -1, -1,'');
INSERT INTO `sys_product_0123456789`(`id`,`last_purchase_price`, `last_sale_price`, `name`, `company_id`, `code`, `product_type_id`, `model`, `unit_id`, `purchase_price`, `sale_price`, `enable_batch`, `enable_fine`, `enable_store`, `fine_days`, `warn_days`, `store_min`, `store_max`, `comments`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,barcode) VALUES (1543373915033511893,0,0, '空调', 200000001, '100200305', 9, '', 3, 799900, 899900, 0, 0, 0, -1, -1, -1, -1, '', 300000001, 1543373915033, -1, -1,'');
INSERT INTO `sys_product_0123456789`(`id`,`last_purchase_price`, `last_sale_price`, `name`, `company_id`, `code`, `product_type_id`, `model`, `unit_id`, `purchase_price`, `sale_price`, `enable_batch`, `enable_fine`, `enable_store`, `fine_days`, `warn_days`, `store_min`, `store_max`, `comments`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,barcode) VALUES (1543373954122693639,0,0, '苏烟', 200000001, '100200306', 4, '', 3, 1850, 2000, 0, 0, 0, -1, -1, -1, -1, '', 300000001, 1543373954122, -1, -1,'');
INSERT INTO `sys_product_0123456789`(`id`,`last_purchase_price`, `last_sale_price`, `name`, `company_id`, `code`, `product_type_id`, `model`, `unit_id`, `purchase_price`, `sale_price`, `enable_batch`, `enable_fine`, `enable_store`, `fine_days`, `warn_days`, `store_min`, `store_max`, `comments`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,barcode) VALUES (1543373998866903712,0,0, '豆子', 200000001, '100200307', 5, '', 3, 360, 530, 0, 0, 0, -1, -1, -1, -1, '', 300000001, 1543373998866, -1, -1,'');
INSERT INTO `sys_product_0123456789`(`id`,`last_purchase_price`, `last_sale_price`, `name`, `company_id`, `code`, `product_type_id`, `model`, `unit_id`, `purchase_price`, `sale_price`, `enable_batch`, `enable_fine`, `enable_store`, `fine_days`, `warn_days`, `store_min`, `store_max`, `comments`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,barcode) VALUES (1543374036149466083,0,0, '鲫鱼', 200000001, '100200308', 6, '', 3, 960, 1800, 0, 0, 0, -1, -1, -1, -1, '', 300000001, 1543374036149, -1, -1,'');
INSERT INTO `sys_product_0123456789`(`id`,`last_purchase_price`, `last_sale_price`, `name`, `company_id`, `code`, `product_type_id`, `model`, `unit_id`, `purchase_price`, `sale_price`, `enable_batch`, `enable_fine`, `enable_store`, `fine_days`, `warn_days`, `store_min`, `store_max`, `comments`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,barcode) VALUES (1543374075420235504,0,0, '娃娃菜', 200000001, '100200309', 7, '', 3, 260, 390, 0, 0, 0, -1, -1, -1, -1, '', 300000001, 1543374075420, -1, -1,'');
INSERT INTO `sys_product_0123456789`(`id`,`last_purchase_price`, `last_sale_price`, `name`, `company_id`, `code`, `product_type_id`, `model`, `unit_id`, `purchase_price`, `sale_price`, `enable_batch`, `enable_fine`, `enable_store`, `fine_days`, `warn_days`, `store_min`, `store_max`, `comments`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,barcode) VALUES (1543374114666273658,0,0, '橘子', 200000001, '100200310', 8, '', 3, 160, 210, 0, 0, 0, -1, -1, -1, -1, '', 300000001, 1543374114666, -1, -1,'');
INSERT INTO `sys_product_0123456789`(`id`,`last_purchase_price`, `last_sale_price`, `name`, `company_id`, `code`, `product_type_id`, `model`, `unit_id`, `purchase_price`, `sale_price`, `enable_batch`, `enable_fine`, `enable_store`, `fine_days`, `warn_days`, `store_min`, `store_max`, `comments`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,barcode) VALUES (1543374147150438737,0,0, '冰箱', 200000001, '100200311', 9, '', 3, 199900, 299900, 0, 0, 0, -1, -1, -1, -1, '', 300000001, 1543374147150, -1, -1,'');
INSERT INTO `sys_product_0123456789`(`id`,`last_purchase_price`, `last_sale_price`, `name`, `company_id`, `code`, `product_type_id`, `model`, `unit_id`, `purchase_price`, `sale_price`, `enable_batch`, `enable_fine`, `enable_store`, `fine_days`, `warn_days`, `store_min`, `store_max`, `comments`, `create_user_id`, `create_time`, `update_user_id`, `update_time`,barcode) VALUES (1544616824726072733,0,0, '全数据商品', 200000001, '001', 4, 'www-xx-001', 3, 10001, 20020, 1, 1, 1, 360, 30, 10, 100, 'eeeadsfasfawef德威', 300000001, 1544616824726, -1, -1,'');
INSERT INTO `sys_product_0123456789`(`id`,`last_purchase_price`, `last_sale_price`, `name`, `company_id`, `code`, `barcode`, `product_type_id`, `model`, `unit_id`, `purchase_price`, `sale_price`, `enable_batch`, `enable_fine`, `enable_store`, `fine_days`, `warn_days`, `store_min`, `store_max`, `comments`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (1546409597735408726,0,0, 'QQ星', 200000001, '955', '6907992511955', 5, '', 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 300000001, 1546409597735, -1, -1);
INSERT INTO `sys_product_0123456789`(`id`,`last_purchase_price`, `last_sale_price`, `name`, `company_id`, `code`, `barcode`, `product_type_id`, `model`, `unit_id`, `purchase_price`, `sale_price`, `enable_batch`, `enable_fine`, `enable_store`, `fine_days`, `warn_days`, `store_min`, `store_max`, `comments`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (1546409676519588697,0,0, '维生素C', 200000001, '1107', '6946803101107', 5, '', 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 300000001, 1546409676519, -1, -1);


TRUNCATE TABLE sys_platform_customer;
INSERT INTO `sys_platform_customer`(`id`,plat_customer_id, `contact`, `contact_phone`,user_number, `remarks`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (100000001,'0123456789', '如来', '13999999999',1, 'eee', 0, 20181227001409, 0, 0);

TRUNCATE TABLE sys_role_menu_0123456789;
insert into sys_role_menu_0123456789(id,role_id,menu_id,company_id)
select @rownum:=@rownum+1,400000001,id,200000001 from (SELECT @rownum:=0) r,sys_menu ;

TRUNCATE TABLE t_resubject_0123456789;
INSERT INTO `t_resubject_0123456789`(`id`,company_id, `type`, `name`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (1,200000001, 1, '收入科目', 1, 1, -1, -1);

INSERT INTO `t_resubject_0123456789`(`id`,company_id, `type`, `name`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (4,200000001, 2, '支出科目', 1, 1, -1, -1);

TRUNCATE TABLE sys_customer_type_0123456789;
INSERT INTO `sys_customer_type_0123456789`(`id`, `name`, `logical_code`, `company_id`, `parent_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (1548065660738824849, '潜在客户', '100', 200000001, -1, 300000001, 1548065660738, -1, -1);
INSERT INTO `sys_customer_type_0123456789`(`id`, `name`, `logical_code`, `company_id`, `parent_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (1548065668630850230, '目标客户', '101', 200000001, -1, 300000001, 1548065668630, -1, -1);
INSERT INTO `sys_customer_type_0123456789`(`id`, `name`, `logical_code`, `company_id`, `parent_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (1548065693155796328, '战略客户', '102', 200000001, -1, 300000001, 1548065693155, -1, -1);
INSERT INTO `sys_customer_type_0123456789`(`id`, `name`, `logical_code`, `company_id`, `parent_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (1548065719194516216, '稳定客户', '102100', 200000001, 1548065693155796328, 300000001, 1548065719194, -1, -1);
INSERT INTO `sys_customer_type_0123456789`(`id`, `name`, `logical_code`, `company_id`, `parent_id`, `create_user_id`, `create_time`, `update_user_id`, `update_time`) VALUES (1548065732487434123, '流失客户', '102101', 200000001, 1548065693155796328, 300000001, 1548065732487, -1, -1);



ALTER TABLE t_store_product_0123456789 ADD UNIQUE index t_store_product_index(product_id,store_id,unit_id,company_id);
ALTER TABLE sys_user_role_0123456789 ADD UNIQUE index sys_user_role_index(user_id,role_id);
ALTER TABLE sys_role_menu_0123456789 ADD UNIQUE index sys_role_menu_index(menu_id,role_id);
ALTER TABLE t_order_detail_0123456789 ADD index t_order_detail_index(order_id);
